package cn.com.thinvent.dispatch.dao;

import cn.com.thinvent.dispatch.entity.ShoppingCart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShoppingCartMapper {

    ShoppingCart getCartById(@Param("id") String id);

    List<ShoppingCart> getCartsByUserId(@Param("createdById") String createdById);

    List<ShoppingCart> getCartsByUserIdPaged(@Param("createdById") String createdById, @Param("limit") int limit, @Param("offset") int offset);

    void insertCart(ShoppingCart cart);

    void updateCart(ShoppingCart cart);

    void deleteCart(@Param("id") String id);

    void deleteCartsByUserId(@Param("createdById") String createdById);

    int countCartsByUserId(@Param("createdById") String createdById);

    int deleteByMenuIdAndCreatedById(@Param("menuId") String menuId, @Param("createdById") String createdById);

}
